import java.io.*;

public final class e extends ByteArrayOutputStream
{

    private DataOutputStream a;

    public e()
    {
        a = null;
    }

    public e(int i)
    {
        super(i);
        a = null;
    }

    public final byte[] a()
    {
        return super.buf;
    }

    public final int b()
    {
        return super.count;
    }

    public final DataOutputStream c()
    {
        if(a == null)
            a = new DataOutputStream(this);
        return a;
    }

    public final int a(InputStream inputstream, int i)
    {
        if(i <= 0)
            return 0;
        int j;
        if((j = super.count + i) > super.buf.length)
        {
            byte abyte0[] = new byte[Math.max(super.buf.length * 2, j)];
            System.arraycopy(super.buf, 0, abyte0, 0, super.count);
            super.buf = abyte0;
        }
        int k = -1;
        try {
            k = inputstream.read(super.buf, super.count, i);
        } catch (IOException e) {
            k = 0;
        }
        if(k > 0)
            super.count += k;
        return k;
    }
}